<template>
	<view class="tab-bar">
		<u-tabbar
			:value="value1"
			@change="change1"
			:fixed="false"
			:placeholder="false"
			:safeAreaInsetBottom="false"
		>
			<u-tabbar-item
				text="首页"
				icon="home"
				name="index"
				@click="click1"
			></u-tabbar-item>
			<u-tabbar-item
				text="菜单"
				icon="photo"
				name="menu"
				@click="click1"
			></u-tabbar-item>
			<u-tabbar-item
				text="订单"
				icon="play-right"
				name="order"
				@click="click1"
			></u-tabbar-item>
			<u-tabbar-item
				text="我的"
				icon="account"
				name="mine"
				@click="click1"
			></u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>
export default {
	name: 'tabbar',
	data() {
		return {
			value1: 0
		};
	},
	methods: {
		click1(navName) {
			uni.navigateTo({
				url: `/pages/${navName}/${navName}`
			});
		},
		change1(e) {
			console.log(e);
		}
	}
};
</script>

<style lang="scss" scoped></style>
